//
//  HJZComment.m
//  HJZWeiBo
//
//  Created by 蒋晨成 on 16/6/3.
//  Copyright © 2016年 蒋晨成. All rights reserved.
//

#import "HJZComment.h"

@implementation HJZComment

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {

}

- (void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"reply_comment"]) {
        self.reply_comment = [[HJZComment alloc] init];
        [self.reply_comment setValuesForKeysWithDictionary:value];
    }else if([key isEqualToString:@"user"]) {
        self.user = [[HJZUser alloc] init];
        [self.user setValuesForKeysWithDictionary:value];
    
    }else{
        [super setValue:value forKey:key];
    }

}


/**
 *  修正发送时间
 */
- (NSString *)created_at
{
    // 获取发送时间 Fri May 09 16:30:34 +0800 2014
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
    [formatter setLocale:locale];
    
    formatter.dateFormat = @"EEE MMM dd HH:mm:ss Z yyyy";
    NSDate *createdDate = [formatter dateFromString:_created_at];
   
    formatter.dateFormat = @"MM-dd HH:mm";
    return [formatter stringFromDate:createdDate];

}



@end
